<!--footer-->
<div class="layout-footer">
    <div class="layout-footer-warp" style="line-height:30px; color: #fff; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; ">
        <p>茂名职业技术学院-政务和公益机构域名注册管理中心《标识证书》</p>
        <p>北校区： 中国广东省茂名市文明北路232号大院（邮编：525000）</p>
        <p>南校区： 中国广东省茂名市电白区沙院镇海城路五路1号（邮编：525027）</p>
    </div>
    <div class="layout-footer-bottom">
        <div class="layout-footer-bottom-warp">
            Copyright © 2018.茂名职业技术学院 All rights reserved.备案号：粤ICP备12035039号-1
        </div>
    </div>
</div>
<!--footer end-->

<div id="messge-box" class="messge-box yj5">
    提示信息</div>
<div class="jump-top-box" style="right: 5px; visibility: visible; top: 606px; display: none;" id="gotoTop">
    <div class="jump-top">
        <a target="_self" href="#">返回顶部</a>
    </div>
</div>
<script type="text/javascript">
    // 获取模块一数据
    $(function() {
        $("#layout-nav-search b").click(function() {
            indexSearch();
        });
        var timeout                   = null
        $('#nav-search-input').on('keyup', function(e) {
            var that                  = this
            clearTimeout(timeout)
            timeout                   = setTimeout(function() {
                getData1({keyword: $.trim($(that).val())})
            }, 500)
        })
    })
    function getData1(params) {
        var url = Model1Url
        $('#indexrepaired').html('')
        $('#indexrepaired').addClass('loading')
        if (params) {
            url = Model1Url + '?' + parseParam(params)
        }

        $.get(url, function(data) {
            if (data.status) {
                setTimeout(function() {
                    for(var i = 0, len = data.data.length; i < len; i++) {
                        Arr.push(data.data[i].id ? data.data[i].id : data.data[i].uid)
                    }
                    $('#indexrepaired').html(normal(data.data, 'mode1'))
                    $('#indexrepaired').removeClass('loading')
                }, 100)
            } else {
                setTimeout(function() {
                    $('#indexrepaired').html(empty(data))
                    $('#indexrepaired').removeClass('loading')
                }, 100)
            }
        })
    }
    function getData2(status) {
        var url = Model2Url
        $('#indexdatahz').html('')
        $('#indexdatahz').addClass('loading')
        if (status) {
            url = Model2Url + '?status=' + status
        }

        $.get(url, function(data) {
            if (data.status) {
                setTimeout(function() {
                    $('#indexdatahz').html(normal(data.data, 'mode2'))
                    $('#indexdatahz').removeClass('loading')
                    a()
                }, 100)
            }
        })
    }

    function getData3(arr) {
        var url             = Model3Url
        var params          = {model: 'repair'}
        $('#indexdatahz').html('')
        $('#indexdatahz').addClass('loading')
        if (arr && arr.length) {
            params.arr      = arr
        }
        url                 = Model3Url + '?' + parseParam(params)
        $.get(url, function(data) {
            if (data.status) {
                window.location.href = data.data.url
            } else {
                alert('系统繁忙，请稍后再试');
            }
        })
    }

    function getData4(params) {
        var url = Model1Url
        $('#showlist').html('')
        $('#showlist').addClass('loading')
        if (params) {
            url                 = Model1Url + '?' + parseParam(params)
        }

        $.get(url, function(data) {
            if (data.status) {
                setTimeout(function() {
                    $('#showlist').html(normal(data.data, 'mode4'))
                    $('#showlist').removeClass('loading')
                }, 1000)
            }
        })
    }

    function indexSearch() {
        if ($("#nav-search-input").val().length == 0) {
            return false;
        }
        $("#search-form").submit();
    }
    function normal(data, mode) {
        var temp = $('#' + mode).html()
        var html = ''
        for (var i = 0, len = data.length; i < len; i++) {
            html += temp.replace(reg, function(a, b, c) {
                return data[i][b] !== null ? data[i][b] : '保密' 
            })
        }

        return html
    }
    function parseParam(param, key){
        var paramStr="";
        if(param instanceof String||param instanceof Number||param instanceof Boolean){
            paramStr+="&"+key+"="+encodeURIComponent(param);
        }else{
            $.each(param,function(i){
                var k=key==null?i:key+(param instanceof Array?"["+i+"]":"."+i);
                paramStr+='&'+parseParam(this, k);
            });
        }
        return paramStr.substr(1)
    }
    function a() {
        var dom         = document.getElementById("main")
        var myChart     = echarts.init(dom)
        var data        = []
        var app         = {}
        $('#indexdatahz').find('.sall').each(function(i, n) {
            data.push($(n).html() * 1)
        })

        option          = null
        option          = {
            xAxis: {
                type: 'category',
                data: ['昨日', '今日', '今周', '今月', '今年']
            },
            yAxis: {
                type: 'value'
            },
            series: [{
                data: data,
                type: 'line',
                symbol: 'triangle',
                symbolSize: 20,
                lineStyle: {
                    normal: {
                        color: 'green',
                        width: 4,
                        type: 'dashed'
                    }
                },
                itemStyle: {
                    normal: {
                        borderWidth: 3,
                        borderColor: 'yellow',
                        color: 'blue'
                    }
                }
            }]
        };
        ;
        if (option && typeof option === "object") {
            myChart.setOption(option, true);
        }
    }
    function empty(data) {
        var temp        = $('#empty').html()
        var html        = ''

        html           += temp.replace(reg, function(a, b, c) {
                       return data[b]
        }) 

        return html
    }
</script>
<script language="javascript" type="text/javascript">
    var loginuser = "0";
    loginuser = "0";
    $(document).ready(function() {
        $(".top-login,.top-exit").click(function() {
            switch ($(this).attr("data-value")) {
                case "登录":
                    $.layer({
                        type: 2,
                        title: false,
                        shadeClose: true,
                        area: ['660px', '360px'],
                        offset: ['130px', ''],
                        iframe: { src: '/pc/account/login/win?ReturnUrl=' + encodeURIComponent(location.href) }
                    });
                    break;
                case "退出":
                    layer.confirm('确定要退出吗？', function() {
                        location.href = '/pc/account/LogOut?ReturnUrl=' + encodeURIComponent(location.href);
                    });
                    break;
            }
        });
        //导航样式选择
        $("#nav-index").addClass("nav-on");
        $(document).on('click', ".btn-ref", function() {
            var mkid = $(this).attr("data-id");
            var obj = $(this);
            $.post('/rsp/site/SaveRefresh', {
                    mkid: mkid
                },
                function(data) {
                    if (data == "0") {
                        obj.html("自动刷新");
                    } else if (data == "1") {
                        obj.html("取消刷新");
                    } else {
                        showMsg("error", data);
                    }
                });
        });
    });
    /*返回顶部*/
    function gotoTop(min_height) {
        //预定义返回顶部的html代码，它的css样式默认为不显示
        var gotoTop_html = '<div id="gotoTop">返回顶部</div>';
        //将返回顶部的html代码插入页面上id为page的元素的末尾
        $("#page").append(gotoTop_html);
        $("#gotoTop").click( //定义返回顶部点击向上滚动的动画
            function() {
                $('html,body').animate({ scrollTop: 0 }, 700);
            }).hover( //为返回顶部增加鼠标进入的反馈效果，用添加删除css类实现
            function() { $(this).addClass("hover"); },
            function() {
                $(this).removeClass("hover");
            });
        //获取页面的最小高度，无传入值则默认为600像素
        min_height ? min_height = min_height : min_height = 600;
        //为窗口的scroll事件绑定处理函数
        $(window).scroll(function() {
            //获取窗口的滚动条的垂直位置
            var s = $(window).scrollTop();
            //当窗口的滚动条的垂直位置大于页面的最小高度时，让返回顶部元素渐现，否则渐隐
            if (s > min_height) {
                $("#gotoTop").fadeIn(100);
            } else {
                $("#gotoTop").fadeOut(200);
            };
        });
    };
    gotoTop();
    if ("0" != "0") {
        //收件箱
        var checkbox = function(url) {
            var msg = $('.top-msg em');
            $.getJSON(url, function(data) {
                if (data.id != null) {
                    if (data.id > 0) {
                        var msgval = data.id;
                        if (data.id != null) {
                            if (Number(data.id) > 10) { msgval = '9+'; }
                            msg.html(msgval); //消息数量
                            //消息声音
                            if (data.id != msg.attr("data-tip")) { //有新消息的时候播放声音
                                $("#wavFileId").hide();
                            }
                            $("#wavFileId").show();
                            msg.attr("data-tip", data.id);
                        }
                        msg.show();
                    } else {
                        msg.hide();
                        $("#wavFileId").hide();
                    }
                }
            });
            setTimeout(function() {
                checkbox(url)
            }, 10000);
        }
        checkbox('/rsp/my/getmsg');
        var msg = $('.top-msg em');
        //消息闪烁
        var timer = null;
        var i = 0;
        clearInterval(timer);
        timer = setInterval(function() {
            var msgcss = i++ % 2 ? "none" : "block";
            if (msg.html() != "0" && msg.html().length > 0) {
                $('.top-msg em').css("display", msgcss); //还是有收获的，这个写法比if..else想必简单了好多 
            }
            //i > 8 && clearInterval(timer); //这个短路用的经典啊 
        }, 800);
    }
</script>
<script type='text/templet' id='mode1'>
    <a href="/pages/progress?id={id}" target="_blank" title='{name}'>
        <ul class="datalist datalist-item indexrepaired" data-id="cf2fcec6-c63b-4f75-984e-a970007a20ff">
            <li class="Bserial">
                <nobr>{id}</nobr>
            </li>
            <li class="BuserName">
                <nobr>{name}</nobr>
            </li>
             <li class="Bcontent">
                <nobr>{repair_desc}</nobr>
            </li>
            
            <li class="Project_Name">
                <nobr>{repair_unit}</nobr>
            </li>
            <li class="Area_Name">
                <nobr>{address}</nobr>
            </li>
            <li class="Btime">
                <nobr>{time}</nobr>
            </li>
            <li class="AcceptDept">
                <nobr>{repair_unit}</nobr>
            </li>
            <li class="AcceptPersonName">
                <nobr>{uuname}</nobr>
            </li>
            <li class="Atime jks3">
                <nobr>
                    {a_hour}
                </nobr>
            </li>
            <li class="Bstate" style="color:">
                <nobr>
                    <em>{c_hour}</em>
                </nobr>
            </li>
        </ul>
    </a>
</script>
<script type='text/templet' id='mode2'>
    <ul class="datalist datalist-item indexdatahz">
        <li class="sj">{name}</li>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'all',t:'td'})"><li class="sall">{all}</li></a>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'0',t:'td'})"><li class="s0 jk jk0">{shen}</li></a>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'1',t:'td'})"><li class="s1 jk jk0">{shou}</li></a>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'2',t:'td'})"><li class="s2 jk jk0">{wei}</li></a>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'3',t:'td'})"><li class="s3 jk jk6">{weied}</li></a>
        <a href="javascript:$.StandardPost('/rsp/site/DataCx',{id:'4',t:'td'})"><li class="s4 jk jk0">{ping}</li></a>
    </ul>
</script>
<script type='text/templet' id='empty'>
    <div class='nobady' style='height: 265px'>
        <img src="__HOME__/img/empty.png" alt="空空如也" />
        <span>{msg}</span>
    </div>
</script>

<!--endfooter-->